<template>
  <div id="main">

		<div class="tabs-light pane tabs-bottom tabs-standard tabs-item-hide" abstract="true" nav-view="active" style="opacity: 1; transform: translate3d(0%, 0px, 0px);">

		  <div class="guess_top">
			  <div class="guess_top_title">
				  <!--玩法介绍-->
				  <div class="guess_top_title_left" @click="openDescPlay('guess_desc_content')">玩法介绍</div>
				  <div class="guess_top_title_center"><marquee id="usertradenickname" behavior="scroll">“157****7015”盈利 10.00 元</marquee></div>
				  <div class="guess_top_title_right" @click="openDescPlay('guess_chart_content')">走势图</div>
			  </div>
			  <!--进度条-->
			  <div class="guess_top_loadingLine" style="margin-top: -0.514599px; width: 260px; height: 278.029px;">
				  <!--canvas-->
				  <canvas id="canvas" width="260" height="278.02919708029196"></canvas>
				  <!--遮盖canvas-->
				  <div class="guess_top_mask">

				  </div>
			  </div>
			  <!--美女-->
			  <div class="girl"></div>
			  <!--大单 极大 小单 大 小 单 双。。。-->
			  <div class="guess_top_orders" style="margin-top: -0.514599px; width: 260px; height: 278.029px;">
				  <div class="guess_top_orders_left">
					  <!--大单-->
					  <div class="guess_top_order_purple guess_top_order_1 guess_height" id="guess0" @click="g_betting('0')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_purple_border" id="guessBorder0" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <!--<div style="height: 1.06%;width: 100%;"></div>-->
					  <div class="guess_top_order_gapx" style="width: 2.84672px; height: 2.84672px;"></div>
					  <!--大-->
					  <div class="guess_top_order_red guess_top_order_2 guess_height" id="guess1" @click="g_betting('1')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_red_border" id="guessBorder1" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="width: 2.84672px; height: 2.84672px;"></div>
					  <!--双-->
					  <div class="guess_top_order_blue guess_top_order_3 guess_height" id="guess2" @click="g_betting('2')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_blue_border" id="guessBorder2" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--大双-->
					  <div class="guess_top_order_purple guess_top_order_4 guess_height" id="guess3" @click="g_betting('3')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_purple_border" id="guessBorder3" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
				  </div>
				  <div class="guess_top_order_gapy" style="width: 1.35%;height: 1px;float: left;"></div>
				  <div class="guess_top_orders_center" style="width: 260px; height: 278.029px;">
					  <!--极大-->
					  <div class="guess_top_order_orange guess_top_order_5 guess_orange" id="guess4" @click="g_betting('4')" style="left: 78.7591px; width: 102.482px; height: 67.3723px;">
						  <div class="guess_orange_border"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--结果-->
					  <div class="guess_top_order_green" style="width: 102.482px; height: 137.591px; top: 70.5353px; left: 78.7591px;">
						  <div class="guess_top_order_green_top" style="width: 102.482px; height: 117.664px; transform: rotateY(0deg);">
							  <!--下单中-->
							  <div class="guess_top_order_green_top_order" style="display: block;">
								  <div class="guess_top_order_green_top_order_top"><div>即将开奖期号</div><div id="curphaseid">20170607-0946</div></div>
								  <div class="guess_top_order_green_top_order_center" id="countDownBox">
									  <div class="orderTimeCoountDown cdNumNormal" style="display: flex;"></div>
									  <div class="orderTimeCoountDown hide cdNumLast" style="display: none;"></div>
								  </div>
								  <div class="guess_top_order_green_top_order_bottom" id="countDownDesc">等待开奖</div>
							  </div>
							  <!--下单结果-->
							  <div class="guess_top_order_green_top_result" style="display: none;">
								  <div class="guess_top_order_green_top_result_top">
									  <div class="result_title result_last_num_back">
										  <div class="result_title_txt">QQ在线人数</div>
										  <div class="result_title_txt"><span class="result_title_txt_num">237,587,</span><span class="result_title_txt_color">302</span></div>
									  </div>
									  <div class="result_last_three">
										  <div class="result_last_num1 result_last_num_back"></div>
										  <div class="result_last_num_add1 result_last_num_back">+</div>
										  <div class="result_last_num2 result_last_num_back"></div>
										  <div class="result_last_num_add2 result_last_num_back">+</div>
										  <div class="result_last_num3 result_last_num_back"></div>
										  <div class="result_last_num_equle result_last_num_back">=</div>
									  </div>
								  </div>
								  <div class="result_number result_last_num_back"></div>
							  </div>
						  </div>
						  <!--往期结果-->
						  <div class="guess_top_order_green_bottom" style="height: 19.927px;">
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--极小-->
					  <div class="guess_top_order_orange guess_top_order_6 guess_orange" id="guess5" @click="g_betting('5')" style="left: 78.7591px; width: 102.482px; height: 67.3723px;">
						  <div class="guess_orange_border" id="guessBorder5" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
				  </div>
				  <div style="width: 1.35%;height: 1px;float: left;"></div>
				  <div class="guess_top_orders_right">
					  <!--小单-->
					  <div class="guess_top_order_purple guess_top_order_7 guess_height" id="guess6" @click="g_betting('6')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_purple_border" id="guessBorder6" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--小-->
					  <div class="guess_top_order_red guess_top_order_8 guess_height" id="guess7" @click="g_betting('7')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_red_border" id="guessBorder7" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--单-->
					  <div class="guess_top_order_blue guess_top_order_9 guess_height activated" id="guess8" @click="g_betting('8')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_blue_border" id="guessBorder8" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
					  <div class="guess_top_order_gapx" style="height: 2.84672px;"></div>
					  <!--小双-->
					  <div class="guess_top_order_purple guess_top_order_10 guess_height" id="guess9" @click="g_betting('9')" style="width: 75.9124px; height: 67.3723px;">
						  <div class="guess_purple_border" id="guessBorder9" style="display: none;"></div>
						  <div class="guess_top_orders_black_bg hide">
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_small hide coin_one"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_center hide coin_five"></div>
							  <div class="guess_top_orders_black_img guess_top_orders_black_img_big hide coin_ten"></div>
						  </div>
					  </div>
				  </div>
			  </div>
			  <div class="guess_top_bottom_row_box guess_top_bottom_row_box_txt">
				  <div class="guess_top_bottom_row_txt">
					  开奖结果取自腾讯音视频主页(http://im.qq.com/album/v/)右上角"当前在线人数",后三位相加为开奖结果
				  </div>
			  </div>
			  <div class="guess_top_bottom_row_box guess_top_bottom_row_box_img" style="display: none;">
				  <div class="guess_top_bottom_row1">
					  <!--<div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px;">
						  <img src="../../static/images/guest/num/num-0.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-1.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
					    <img src="../../static/images/guest/num/num-2.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-3.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
					    <img src="../../static/images/guest/num/num-4.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-5.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
					    <img src="../../static/images/guest/num/num-6.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
					    <img src="../../static/images/guest/num/num-7.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-8.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-9.png" alt=""></div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-10.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-11.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-12.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-13.png" alt="">
					  </div>-->
				  </div>
				  <div class="guess_top_bottom_row2">
					  <!--<div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px;">
					    <img src="../../static/images/guest/num/num-14.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-15.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-16.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-17.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-18.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-19.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-20.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-21.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-22.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-23.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-24.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-25.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-26.png" alt="">
					  </div>
					  <div class="guess_top_bottom_num_wh" style="height: 19px; width: 19px; line-height: 19px; margin-left: 2px;">
						  <img src="../../static/images/guest/num/num-27.png" alt="">
					  </div>-->
				  </div>
			  </div>
		  </div>

		  <div class="guess_bottom">
			  <div class="guess_bottom_chess">
				  <div class="guess_bottom_chess_left">
					  <div class="guess_sound" @click="music_onoff()" style="height: 28px; width: 28px;"></div>
				  </div>
				  <div class="guess_bottom_chess_center">
					  <div class="guess_bottom_chess_one guess_bottom_chess_num_box" id="one" @click="showChip('10','one')" style="height: 50.4px; width: 50.4px;">
						  <div class="guess_bottom_chess_one_bg"></div>
						  <div class="guess_bottom_chess_one_glow" v-if="10==chipFlag"></div>
					  </div>
					  <div class="guess_bottom_chess_five guess_bottom_chess_num_box" id="five" @click="showChip('50','five')" style="height: 50.4px; width: 50.4px;">
						  <div class="guess_bottom_chess_five_bg"></div>
						  <div class="guess_bottom_chess_five_glow" v-if="50==chipFlag"></div>
					  </div>
					  <div class="guess_bottom_chess_ten guess_bottom_chess_num_box" id="ten" @click="showChip('100','ten')" style="height: 50.4px; width: 50.4px;">
						  <div class="guess_bottom_chess_ten_bg"></div>
						  <div class="guess_bottom_chess_ten_glow" v-if="100==chipFlag"></div>
					  </div>
				  </div>
				  <div class="guess_bottom_chess_right">
					  <div class="guess_cancle" @click="g_bettingcancel()" style="height: 28px; width: 28px;"></div>
				  </div>
			  </div>
			  <div class="guess_bottom_userinfo">
				  <div class="guess_bottom_userinfo_money" id="userMoney">余额：<span id="accountMoney">9996</span></div>
				  <div class="guess_bottom_userinfo_recharge">
					  <div class="guess_bottom_userinfo_recharge_btn" @click="guessRecharge()">充值</div>
				  </div>
				  <div class="guess_bottom_userinfo_order ng-binding" style="display: none;" id="bettleMoneyDiv">
					  已下注：0(手续费0元)
				  </div>
			  </div>
		  </div>

		</div>
  </div>
</template>
<script>
	export default{
	  data () {
	    return{
		    GRID_ID_PREFIX: "guess",
		    targetId: "",
			  horn: "1",
			  type: "R",
			  coinTypeMap: {
				  one: 10,
				  five: 50,
				  ten: 100
			  },
		    girdsInfoMap: {
			    guess0: {
				    gridid: "guess0",
				    shownum: "15;17;19;21;23;25;27"
			    },
			    guess1: {
				    gridid: "guess1",
				    shownum: "14;15;16;17;18;19;20;21;22;23;24;25;26;27"
			    },
			    guess2: {
				    gridid: "guess2",
				    shownum: "0;2;4;6;8;10;12;14;16;18;20;22;24;26"
			    },
			    guess3: {
				    gridid: "guess3",
				    shownum: "14;16;18;20;22;24;26"
			    },
			    guess4: {
				    gridid: "guess4",
				    shownum: ""
			    },
			    guess5: {
				    gridid: "guess5",
				    shownum: ""
			    },
			    guess6: {
				    gridid: "guess6",
				    shownum: "1;3;5;7;9;11;13"
			    },
			    guess7: {
				    gridid: "guess7",
				    shownum: "0;1;2;3;4;5;6;7;8;9;10;11;12;13"
			    },
			    guess8: {
				    gridid: "guess8",
				    shownum: "1;3;5;7;9;11;13;15;17;19;21;23;25;27"
			    },
			    guess9: {
				    gridid: "guess9",
				    shownum: "0;2;4;6;8;10;12"
			    }
		    },
		    chipFlag: "",
		    myPage: {
			    chipStartId: [],
			    chooseChipId: "one",
			    targetId: ""
		    },
		    accountMoney: 0,
			  winsAniNums: 0,
			  bettingInfo: {
				  maxBetting: 1000,
				  noBettingFlag: false,
				  gtrade_time_out: 0,
				  cfRate: 0.1,
				  curBetting: 0,
				  curCounterFee: 0,
				  gridInfo: {}
			  },
			  ballNumArray: [],
			  audioMap: {},
			  muteFlag: false,
		    chipFlag: 10,
		    curBetting: "0",
		    curCountFee: "0",
		    historyNumList: [],
		    curphaseid: "",
		    timeoutss: 0,
		    originalWH: {
			    outter: {
				    w: 822,
				    h: 879
			    },
			    child1: {
				    w: 240,
				    h: 213
			    },
			    child2: {
				    w: 324,
				    h: 213
			    },
			    child3: {
				    w: 324,
				    h: 372
			    },
			    position: {
				    left: 249,
				    top: 223
			    }
		    },
				billId: ""

	    } // end return
	  },
		mounted () {

			global.curphaseids = "20170608-1049";
			global.queryRetSrvJson = {};
			global.winningNumberObj = {
				firstStr: "",
				lastStr: "",
				lastNumArray: [],
				lastNumSum: 0
			}
			global.srvJson = {
				gtradesrvstat: {
					curphaseid: "20170608-0956",
					timeoutss: "40"
				},
				usertrades: {
					nickname: "147****2086",
					torderdir: "",
					tordernum: 5,
					ttargetid: "QQ_ONLINE",
					ttradeprofit: 50
				}
			}
			srvJson.history = []
			srvJson.history.push({"curphaseid":"20170608-1051","luckynum":241688525,"details":[]},{"curphaseid":"20170608-1050","luckynum":241612146},{"curphaseid":"20170608-1049","luckynum":241645163},{"curphaseid":"20170608-1048","luckynum":241569827},{"curphaseid":"20170608-1047","luckynum":241594748},{"curphaseid":"20170608-1046","luckynum":241576032},{"curphaseid":"20170608-1045","luckynum":241567735},{"curphaseid":"20170608-1044","luckynum":241574553},{"curphaseid":"20170608-1043","luckynum":241569700},{"curphaseid":"20170608-1042","luckynum":241552963},{"curphaseid":"20170608-1041","luckynum":241507541},{"curphaseid":"20170608-1040","luckynum":241478899},{"curphaseid":"20170608-1039","luckynum":241452000},{"curphaseid":"20170608-1038","luckynum":241427568},{"curphaseid":"20170608-1037","luckynum":241344412},{"curphaseid":"20170608-1036","luckynum":241389085},{"curphaseid":"20170608-1035","luckynum":241381534},{"curphaseid":"20170608-1034","luckynum":241384704},{"curphaseid":"20170608-1033","luckynum":241389790},{"curphaseid":"20170608-1032","luckynum":241401953})
			global.countDownObj = {};
			countDownObj.getadustTimeMap = function() {
				return {
					"420": false,
					"370": false,
					"300": false,
					"230": false,
					"150": false
				}
			}
			;
			countDownObj.adustTimeMap = countDownObj.getadustTimeMap();
			countDownObj.cdCanvas = null;
			countDownObj.DEF_INV = 100;
			countDownObj.CD_ALLTIME = 60;
			countDownObj.countdownInterval = countDownObj.DEF_INV;
			countDownObj.countdownType = 2;
			countDownObj.curccNum = countDownObj.CD_ALLTIME * 10;
			countDownObj.cdSetFlag = false;
			global.JSUtils = {
				system: {
					addHandler: function(element, type, handler) {
						if (element.addEventListener) {
							element.addEventListener(type, handler, false)
						} else {
							if (element.attachEvent) {
								element.attachEvent("on" + type, handler)
							} else {
								element["on" + type] = handler
							}
						}
					},
					setTimeOut: function(callback, timeout, param) {
						var args = Array.prototype.slice.call(arguments, 2);
						var _cb = function() {
							callback.apply(null, args)
						};
						return window.setTimeout(_cb, timeout)
					},
					setInterval: function(callback, timeout, param) {
						var args = Array.prototype.slice.call(arguments, 2);
						var _cb = function() {
							callback.apply(null, args)
						};
						return window.setInterval(_cb, timeout)
					},
					getPageParamVal: function(name) {
						var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
						var r = window.location.search.substr(1).match(reg);
						if (r != null) {
							return r[2]
						} else {
							return null
						}
					}
				},
				number: {
					getSepNum: function(inputValue, minValue, maxValue) {
						if (inputValue < minValue) {
							inputValue = minValue
						} else {
							if (inputValue > maxValue) {
								inputValue = maxValue
							}
						}
						return inputValue
					},
					getMin: function(val1, val2) {
						if (val1 > val2) {
							return val2
						} else {
							return val1
						}
					},
					getMax: function(val1, val2) {
						if (val1 > val2) {
							return val1
						} else {
							return val2
						}
					},
					getRandomInt: function(min, max) {
						if (min > max || max < 0) {
							throw "getRandomInt  指定参数错误"
						}
						var tmp = 0;
						if (min < 0) {
							tmp = min;
							max = max - min;
							min = 0
						}
						return JSUtils.number.chnInt(Math.random() * (max - min + 1) + min) + tmp
					},
					getFormatNum: function(num) {
						if (isNaN(JSUtils.number.chnInt(num))) {
							return num
						}
						if (JSUtils.number.chnInt(num) == parseFloat(num)) {
							return JSUtils.number.chnInt(num)
						} else {
							return parseFloat(num)
						}
					},
					formatNumeric: function(num, numericLen) {
						var val = Math.pow(10, numericLen);
						num = JSUtils.number.chnInt(Math.round(num * val)) / val;
						var str = num.toString();
						var str1, num1, num2 = str.indexOf(".");
						if (num2 == -1) {
							num1 = numericLen;
							if (numericLen != 0) {
								str += "."
							}
						} else {
							str1 = str.substr(num2 + 1, str.length);
							num1 = numericLen - str1.length
						}
						var str2 = "";
						for (var i = 0; i < num1; i++) {
							str2 += "0"
						}
						return str + str2
					},
					formatMoney: function(num) {
						return JSUtils.number.formatNumeric(num, 2)
					},
					IN: function(val, array) {
						for (var i = 0; i < array.length; i++) {
							if (val == array[i]) {
								return true
							}
						}
						return false
					},
					chnInt: function(req) {
						return parseInt(req, 10)
					},
					oneFloat: function(param) {
						var param = param + "";
						var strarr = param.split(".");
						if (strarr.length <= 1) {
							strarr.push("0")
						} else {
							if (strarr[1].length > 1) {
								strarr[1] = (strarr[1] + "").substr(0, 1)
							}
						}
						return strarr
					},
					fiveFloat: function(param) {
						var param = param + "";
						var strarr = param.split(".");
						if (strarr.length <= 1) {
							strarr.push("00000")
						} else {
							if (strarr[1].length >= 5) {
								strarr[1] = (strarr[1] + "").substr(0, 5)
							} else {
								if (strarr[1].length < 5 || strarr[1].length > 0) {
									if (strarr[1].length == 1) {
										strarr[1] = strarr[1] + "0000"
									} else {
										if (strarr[1].length == 2) {
											strarr[1] = strarr[1] + "000"
										} else {
											if (strarr[1].length == 3) {
												strarr[1] = strarr[1] + "00"
											} else {
												if (strarr[1].length == 4) {
													strarr[1] = strarr[1] + "0"
												}
											}
										}
									}
								}
							}
						}
						return strarr
					},
					moneySplitIntAndFloat: function(money) {
						money = JSUtils.number.formatMoney(money);
						if (!money) {
							return ["0", "00"]
						} else {
							var str = money + "";
							var strarr = str.split(".");
							if (strarr.length <= 1) {
								strarr.push("00")
							} else {
								if (strarr[1].length <= 1) {
									strarr[1] += "0"
								} else {
									if (strarr[1].length > 1) {
										strarr[1] = strarr[1].substr(0, 2)
									}
								}
							}
							return strarr
						}
					}
				},
				object: {
					hasProperty: function(obj) {
						for (var i in obj) {
							return true
						}
						return false
					},
					hasSepProperty: function(obj, propName) {
						return obj.hasOwnProperty(propName)
					},
					deleteSepProperty: function(obj, propName) {
						delete obj[propName]
					},
					exist: function(obj) {
						try {
							if (obj == null) {
								return false
							}
							if (obj == undefined) {
								return false
							}
							return typeof (obj) != "undefined"
						} catch (e) {
							return false
						}
					},
					strToJsonObj: function(jsonStr) {
						if (JSUtils.string.isAvailably(jsonStr)) {
							return eval("(" + jsonStr + ")")
						}
						return eval("(null)")
					},
					toJsonStr: function(obj) {
						return JSON.stringify(obj)
					},
					jsonClone: function(jsonObj) {
						var buf;
						if (jsonObj instanceof Array) {
							buf = [];
							var i = jsonObj.length;
							while (i--) {
								buf[i] = JSUtils.object.jsonClone(jsonObj[i])
							}
							return buf
						} else {
							if (jsonObj instanceof Object) {
								buf = {};
								for (var k in jsonObj) {
									buf[k] = JSUtils.object.jsonClone(jsonObj[k])
								}
								return buf
							} else {
								return jsonObj
							}
						}
					},
					arraySort: function(array, order, columnName) {
						array.sort(function(obj1, obj2) {
							var val1, val2, tmpVal;
							var ret;
							val1 = obj1[columnName];
							val2 = obj2[columnName];
							if (order == 0) {
								tmpVal = val2;
								val2 = val1;
								val1 = tmpVal
							}
							if (val1 < val2) {
								ret = -1
							} else {
								if (val1 > val2) {
									ret = 1
								} else {
									ret = 0
								}
							}
							return ret
						})
					}
				},
				string: {
					isAvailably: function(str) {
						if (str == null) {
							return false
						}
						if (typeof (str) == "undefined") {
							return false
						}
						if (str == "") {
							return false
						}
						if (str == "null" || str == "undefined") {
							return false
						}
						return true
					},
					getAvailablyString: function(str1, str2) {
						return JSUtils.string.isAvailably(str1) ? str1 : str2
					},
					getFormatString: function(str, replaceWords) {
						var ret = str;
						if (replaceWords == null) {
							return str
						}
						for (var i = 0; i < replaceWords.length; i++) {
							var re = eval("/\\{" + i + "\\}/ig");
							ret = ret.replace(re, replaceWords[i])
						}
						return ret
					},
					replaceWord: function(source, rep1, rep2) {
						return source.replace(new RegExp(rep1,"gm"), rep2)
					},
					getStressHtml: function(str, replaceWords, stressWordCss) {
						if (replaceWords == null) {
							return str
						}
						for (var i = 0; i < replaceWords.length; i++) {
							var tmpRepObj = replaceWords[i];
							if (typeof (tmpRepObj) == "object") {
								replaceWords[i] = JSUtils.string.getReplaceSpan(tmpRepObj.css, tmpRepObj.word)
							} else {
								replaceWords[i] = JSUtils.string.getReplaceSpan(stressWordCss, tmpRepObj)
							}
						}
						return JSUtils.string.getFormatString(str, replaceWords)
					},
					getNormalHtml: function(str, replaceWords, stressWordCss) {
						if (replaceWords == null) {
							return str
						}
						for (var i = 0; i < replaceWords.length; i++) {
							var tmpRepObj = replaceWords[i];
							if (typeof (tmpRepObj) == "object") {
								replaceWords[i] = "<span class='noempty " + tmpRepObj.css + "'>" + tmpRepObj.word + "</span>"
							} else {
								replaceWords[i] = "<span class='noempty " + stressWordCss + "'>" + tmpRepObj + "</span>"
							}
						}
						return JSUtils.string.getFormatString(str, replaceWords)
					},
					getReplaceSpan: function(css, word) {
						return "<span class='noempty " + css + "'> " + word + " </span>"
					},
					getRandomUrlParams: function() {
						return "random=" + (new Date().getTime() + Math.random())
					},
					startWith: function(sourceStr, startStr) {
						var d = startStr.length;
						return ( d >= 0 && sourceStr.indexOf(startStr) == 0)
					},
					endWith: function(sourceStr, endStr) {
						var d = sourceStr.length - endStr.length;
						return ( d >= 0 && sourceStr.lastIndexOf(endStr) == d)
					},
					contains: function(sourceStr, containStr) {
						return ( sourceStr.indexOf(containStr) > 0)
					},
					phoneToShow: function(phoneNum) {
						if (!JSUtils.form.check.isPhone(phoneNum)) {
							return phoneNum
						}
						return phoneNum.substring(0, 3) + "******" + phoneNum.substring(phoneNum.length - 2, phoneNum.length)
					}
				},
				form: {
					check: {
						isEmpty: function(objVal) {
							return !JSUtils.string.isAvailably(objVal)
						},
						isMail: function(objVal) {
							var pattern = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
							return pattern.test(objVal)
						},
						isDigit: function(objVal) {
							var reg = new RegExp("^[0-9]*$");
							return reg.test(objVal)
						},
						isPhone: function(str) {
							var re = /^(13[0-9]{9})|(14[0-9]{9})|(15[0-9]{9})|(18[0-9]{9})$/;
							return re.test(str)
						}
					}
				},
				data: {},
				localSave: {
					get: function(key) {
						var localStr = window.localStorage.getItem(key);
						return JSUtils.object.strToJsonObj(localStr)
					},
					set: function(key, val) {
						var localStr = JSUtils.object.toJsonStr(val);
						window.localStorage.setItem(key, localStr)
					},
					remove: function(key) {
						window.localStorage.removeItem(key)
					},
					sessionGet: function(key) {
						var localStr = window.sessionStorage.getItem(key);
						return JSUtils.object.strToJsonObj(localStr)
					},
					sessionSet: function(key, val) {
						var localStr = JSUtils.object.toJsonStr(val);
						window.sessionStorage.setItem(key, localStr)
					},
					sessionRemove: function(key) {
						window.sessionStorage.removeItem(key)
					}
				},
				date: {
					timeStrTODate: function(timeStr) {
						if (!JSUtils.string.isAvailably(timeStr)) {
							return null
						}
						if (timeStr.length != 14) {
							return null
						}
						var str = timeStr.substr(0, 4) + "/" + timeStr.substr(4, 2) + "/" + timeStr.substr(6, 2) + " " + timeStr.substr(8, 2) + ":" + timeStr.substr(10, 2) + ":" + timeStr.substr(12, 2);
						return new Date(str)
					},
					timeStrToTime: function(timeStr) {
						if (!JSUtils.string.isAvailably(timeStr)) {
							return null
						}
						if (timeStr.length != 14) {
							return null
						}
						return timeStr.substr(4, 2) + "." + timeStr.substr(6, 2) + " - " + timeStr.substr(8, 2) + ":" + timeStr.substr(10, 2) + ":" + timeStr.substr(12, 2)
					},
					dateToTimeStr: function(data) {
						var year = data.getFullYear();
						var month = "";
						var date = "";
						var hours = "";
						var minutes = "";
						var seconds = "";
						if ((Number(data.getMonth()) + 1) < 10) {
							month = "0" + (Number(data.getMonth()) + 1)
						} else {
							month = (Number(data.getMonth()) + 1)
						}
						if (Number(data.getDate()) < 10) {
							date = "0" + data.getDate()
						} else {
							date = data.getDate()
						}
						if (Number(data.getHours()) < 10) {
							hours = "0" + data.getHours()
						} else {
							hours = data.getHours()
						}
						if (Number(data.getMinutes()) < 10) {
							minutes = "0" + data.getMinutes()
						} else {
							minutes = data.getMinutes()
						}
						if (Number(data.getSeconds()) < 10) {
							seconds = "0" + data.getSeconds()
						} else {
							seconds = data.getSeconds()
						}
						return year + month + date + hours + minutes + seconds
					}
				},
				curApp: {
					isApp: function() {
						if (window.trade && window.trade.gettype) {
							var str = window.trade.gettype();
							var strObj = JSUtils.object.strToJsonObj(str);
							return strObj.type
						} else {
							return false
						}
					},
					iosCopy: function(val) {
						if (window.trade && window.trade.copynumber) {
							window.trade.copynumber(val)
						}
					},
					constants: {
						urlHistory: false,
						targetType: function(data) {
							if (!JSUtils.string.isAvailably(data)) {
								return JSUtils.localSave.get("targetTypeObj")
							}
							var dataInfos = data.data["targetinfos"];
							var dataInfosObj = {};
							for (var i = 0; i < dataInfos.length; i++) {
								dataInfosObj[dataInfos[i]["id"]] = dataInfos[i]["type"]
							}
							JSUtils.localSave.set("targetTypeObj", dataInfosObj)
						},
						analogTradeId: "BTC_JPY"
					},
					withDraw: false,
					bankinfo: function() {
						var bankinfo = JSUtils.localSave.get("bankinfoLists");
						var obj = {};
						for (var i = 0; i < bankinfo.length; i++) {
							obj[bankinfo[i]["bank_id"]] = bankinfo[i]["bank_name"];
							obj[bankinfo[i]["bank_name"]] = bankinfo[i]["bank_id"]
						}
						return obj
					},
					sessionObj: {
						put: function(key, value) {
							if (!JSUtils.string.isAvailably(value)) {
								return
							}
							var sessionObj = JSUtils.curApp.sessionObj.__getObj();
							if (!sessionObj) {
								sessionObj = {}
							}
							sessionObj[key] = value;
							JSUtils.curApp.sessionObj.__saveObj(sessionObj)
						},
						get: function(key) {
							var sessionObj = JSUtils.curApp.sessionObj.__getObj();
							if (sessionObj) {
								return sessionObj[key]
							}
							return ""
						},
						__getObj: function() {
							var sessionObj = JSUtils.localSave.get("sessionObj");
							if (!sessionObj) {
								sessionObj = {}
							}
							return sessionObj
						},
						__saveObj: function(sobj) {
							JSUtils.localSave.set("sessionObj", sobj)
						}
					}
				}
			};
			global.timeOutControl = {
				secTimeout: -1,
				srvQueryRetTimeout: -1,
				reInitTimeout: -1,
				srvNoMarkTimeout: -1,
				flyCoinTimeout: -1,
				reinitTimeout: -1
			}

			global.horseContent = "";
			global.horseContent = "";
			global.usertradenickname = "";
			global.usertrattradeprofit = "";




	  	this.g_pageInit()
		},
		methods: {
			showChip (num, id) {
				this.chipFlag = num;
				this.myPage.chooseChipId = id
			},
			g_betting (index) {

				if (this.bettingInfo.noBettingFlag) {
					return
				}
				if (!JSUtils.string.isAvailably(this.myPage.chooseChipId)) {
					alert("请选择币种");
					return
				}
				var bMeony = this.coinTypeMap[this.myPage.chooseChipId];
				var cfMoney = bMeony * this.bettingInfo.cfRate;
				/*if ((bMeony + cfMoney) > this.accountMoney) {
					alert("余额不足");
					return
				}
				if (this.bettingInfo.curBetting + bMeony > this.bettingInfo.maxBetting) {
					alert("已达到最大下注金额");
					return
				}*/
				var gridId = this.GRID_ID_PREFIX + index;
				this.g_betting_grid(gridId, bMeony, this.myPage.chooseChipId, true, true)
			},
			g_betting_grid (gridId, bMeony, coinType, changeSuplusMoneyFlag, musicAnimationFlag) {

				var self = this
				var cfMoney = bMeony * this.bettingInfo.cfRate;
				var bettObj;
				if (JSUtils.object.hasSepProperty(this.bettingInfo.gridInfo, gridId)) {
					bettObj = this.bettingInfo.gridInfo[gridId]
				} else {
					bettObj = {
						gridid: gridId,
						gridmoney: 0,
						lastcointype: ""
					};
					this.bettingInfo.gridInfo[gridId] = bettObj
				}

				bettObj.gridmoney = bettObj.gridmoney + bMeony;
				bettObj.lastcointype = coinType;
				$("#bettleMoneyDiv").show();
				 this.bettingInfo.curBetting = this.bettingInfo.curBetting + bMeony;
				this.curBetting = JSUtils.number.formatNumeric(this.bettingInfo.curBetting, 0);
				 this.bettingInfo.curCounterFee = this.bettingInfo.curCounterFee + cfMoney;
				this.curCountFee = JSUtils.number.formatNumeric(this.bettingInfo.curCounterFee, 0);
				if (changeSuplusMoneyFlag) {
					var accountMoney = accountMoney - bMeony - cfMoney;
					$("#accountMoney").text(JSUtils.number.formatNumeric(accountMoney, 0))
				}
				$(".guess_top_bottom_row_box_txt").hide();
				$(".guess_top_bottom_row_box_img").show();
				this.g_changeBallByGuess(gridId);
				if (musicAnimationFlag) {
					this.g_musicPlay(2);
					parabola(this.g_creatChipDom(coinType), gridId, function() {
						self.g_showOrdersinfos(gridId)
					})
				} else {
					this.g_showOrdersinfos(gridId)
				}
			},
			g_creatChipDom (coinType) {
				var domId = JSUtils.date.dateToTimeStr(new Date()) + "" + (new Date()).getMilliseconds();
				var newNode = document.createElement("div");
				newNode.setAttribute("class", "guess_bottom_chess_" + coinType + "_bg");
				newNode.setAttribute("id", domId);
				newNode.style.position = "absolute";
				newNode.style.zIndex = "10";
				newNode.style.top = "0";
				newNode.style.left = "0";
				document.getElementById(coinType).appendChild(newNode);
				return newNode
			},
			g_changeBallByGuess (guessId) {
				var guessOne = this.girdsInfoMap[guessId];
				if (!JSUtils.object.exist(guessOne)) {
					return
				}
				var tmpArr = guessOne.shownum.split(";");
				if (!JSUtils.string.isAvailably(tmpArr)) {
					return
				}
				for (var i = 0; i < tmpArr.length; i++) {
					var tmp = tmpArr[i];
					if (JSUtils.string.isAvailably(tmp)) {
						this.g_changeBallNum(2, tmp)
					}
				}
			},
			g_changeBallNum (flag, index) {
				console.log(flag)
				var imgObj = this.ballNumArray[index];
				if (flag == 1) {
					$(imgObj).attr("src", "../static/images/guest/num/num-" + index + ".png")
				} else {
					$(imgObj).attr("src", "../static/images/guest/num/num-on-" + index + ".png")
				}
			},
			hasSepProperty (obj, propName) {
				return obj.hasOwnProperty(propName)
			},
			g_showOrdersinfos (gridId) {
				if (!JSUtils.object.exist(this.bettingInfo.gridInfo[gridId])) {
					return
				}
				var domOuter1 = $(".guess_top_orders_black_bg", $("#" + gridId));
				domOuter1.show();
				$(".guess_top_orders_black_img", domOuter1).hide();
				$(".coin_" + this.bettingInfo.gridInfo[gridId].lastcointype, domOuter1).show().text(this.bettingInfo.gridInfo[gridId].gridmoney)
			},
			g_musicPlay (musicType) {
				try {
					this.audioMap[musicType].obj.play()
				} catch (e) {
					try {
						if (musicType != "1") {
							this.audioMap[musicType].obj.pause();
							this.audioMap[musicType].obj.currentTime = 0
						}
						this.audioMap[musicType].obj.play()
					} catch (e) {}
				}
			},
			g_adjustPageInitWH() {
				var titleWidth = document.getElementsByClassName("guess_top_title")[0].offsetWidth - 60;
				var titleHeight = document.getElementsByClassName("guess_top_title")[0].offsetHeight;
				var numHeight = document.getElementsByClassName("guess_top_bottom_row_box")[0].offsetHeight;
				var totleHeight = document.getElementsByClassName("guess_top")[0].offsetHeight;
				var lineHeight = titleWidth * this.originalWH.outter.h / this.originalWH.outter.w;
				var marginHeight = (totleHeight - numHeight - titleHeight - lineHeight) / 2;
				document.getElementsByClassName("guess_top_loadingLine")[0].style.marginTop = marginHeight + "px";
				document.getElementsByClassName("guess_top_orders")[0].style.marginTop = marginHeight + "px";
				document.getElementsByClassName("guess_top_loadingLine")[0].style.width = titleWidth + "px";
				document.getElementsByClassName("guess_top_loadingLine")[0].style.height = lineHeight + "px";
				document.getElementsByClassName("guess_top_orders")[0].style.width = titleWidth + "px";
				document.getElementsByClassName("guess_top_orders")[0].style.height = lineHeight + "px";
				document.getElementsByClassName("guess_top_orders_center")[0].style.width = titleWidth + "px";
				document.getElementsByClassName("guess_top_orders_center")[0].style.height = lineHeight + "px";
				var blueWidth = titleWidth * this.originalWH.child1.w / this.originalWH.outter.w;
				var blueHeight = lineHeight * this.originalWH.child1.h / this.originalWH.outter.h;
				var orangeWidth = titleWidth * this.originalWH.child2.w / this.originalWH.outter.w;
				var orangeHeight = blueHeight;
				var gapWidth = (titleWidth - blueWidth * 2 - orangeWidth) / 2;
				var gapHeight = (lineHeight - blueHeight * 4) / 3;
				$("#dealerOne").css({
					width: blueWidth + "px",
					height: blueHeight + "px"
				});
				document.getElementsByClassName("guess_top_order_green")[0].style.width = orangeWidth + "px";
				document.getElementsByClassName("guess_top_order_green")[0].style.height = blueHeight * 2 + gapHeight + "px";
				var domLeft = titleWidth * this.originalWH.position.left / this.originalWH.outter.w + "px";
				var domTop = lineHeight * this.originalWH.position.top / this.originalWH.outter.h + "px";
				document.getElementsByClassName("guess_top_order_green")[0].style.top = domTop;
				document.getElementsByClassName("guess_top_order_green")[0].style.left = domLeft;
				document.getElementById("guess4").style.left = domLeft;
				document.getElementById("guess5").style.left = domLeft;
				document.getElementsByClassName("guess_orange")[0].style.width = orangeWidth + "px";
				document.getElementsByClassName("guess_orange")[0].style.height = orangeHeight + "px";
				document.getElementsByClassName("guess_orange")[1].style.width = orangeWidth + "px";
				document.getElementsByClassName("guess_orange")[1].style.height = orangeHeight + "px";
				document.getElementsByClassName("guess_top_order_green_top")[0].style.width = orangeWidth + "px";
				document.getElementsByClassName("guess_top_order_green_top")[0].style.height = orangeWidth * this.originalWH.child3.h / this.originalWH.child3.w + "px";
				document.getElementsByClassName("guess_top_order_green_bottom")[0].style.height = blueHeight * 2 + gapHeight - orangeWidth * this.originalWH.child3.h / this.originalWH.child3.w + "px";
				var green_bottom_num_obj = document.getElementsByClassName("guess_top_order_green_bottom_num");
				for (var m = 0; m < green_bottom_num_obj.length; m++) {
					green_bottom_num_obj[m].style.width = orangeWidth * 0.15 + "px";
					green_bottom_num_obj[m].style.height = orangeWidth * 0.15 + "px"
				}
				var gapobj = document.getElementsByClassName("guess_top_order_gapx");
				document.getElementsByClassName("guess_top_order_gapx")[0].style.width = gapWidth + "px";
				document.getElementsByClassName("guess_top_order_gapx")[1].style.width = gapWidth + "px";
				for (var i = 0; i < gapobj.length; i++) {
					gapobj[i].style.height = gapHeight + "px"
				}
				var heightobj = document.getElementsByClassName("guess_height");
				for (var j = 0; j < heightobj.length; j++) {
					heightobj[j].style.width = blueWidth + "px";
					heightobj[j].style.height = blueHeight + "px"
				}
				var numWH = $(window).width() //document.getElementsByClassName("guess_top_bottom_row1")[0].offsetWidth;
				var numChildren = document.getElementsByClassName("guess_top_bottom_num_wh");
				var numChildrenWidth = Math.floor(numWH * (0.87) / 14);
				for (var n = 0; n < 28; n++) {
					numChildren[n].style.height = numChildrenWidth + "px";
					numChildren[n].style.width = numChildrenWidth + "px";
					numChildren[n].style.lineHeight = numChildrenWidth + "px";
					if (n == 0 || n == 14) {
						continue
					}
					numChildren[n].style.marginLeft = Math.floor(numWH * (0.008)) + "px"
				}
				var soundHeight = document.getElementsByClassName("guess_bottom_chess_left")[0].offsetHeight;
				document.getElementsByClassName("guess_sound")[0].style.height = soundHeight / 2 + "px";
				document.getElementsByClassName("guess_sound")[0].style.width = soundHeight / 2 + "px";
				document.getElementsByClassName("guess_cancle")[0].style.height = soundHeight / 2 + "px";
				document.getElementsByClassName("guess_cancle")[0].style.width = soundHeight / 2 + "px";
				for (var y = 0; y < 3; y++) {
					document.getElementsByClassName("guess_bottom_chess_num_box")[y].style.height = soundHeight * 0.9 + "px";
					document.getElementsByClassName("guess_bottom_chess_num_box")[y].style.width = soundHeight * 0.9 + "px"
				}
				countDownObj.cdCanvas = new DrawCircle();
				var canvasObj = document.getElementById("canvas");
				canvasObj.setAttribute("width", titleWidth.toString());
				canvasObj.setAttribute("height", lineHeight.toString());
				var hh = orangeWidth * this.originalWH.child3.h / this.originalWH.child3.w;
				countDownObj.cdCanvas.drawCircleInit("canvas", {
					x: parseFloat(domLeft) + orangeWidth / 2,
					y: parseFloat(domTop) + hh / 2
				}, hh, 1.5, "#072060");
				$(".guess_top_bottom_row_box_img").hide()
			},
			g_initBallNumArray () {
				var smallOuter = $(".guess_top_bottom_row1");
				var bigOuter = $(".guess_top_bottom_row2");
				var imgObj, imgOuter, i;
				for (i = 0; i <= 27; i++) {
					imgObj = $('<img src="../static/images/guest/num/num-' + i + '.png" alt=""/>');
					imgOuter = $('<div class="guess_top_bottom_num_wh" ></div>').append(imgObj);
					if (i < 14) {
						smallOuter.append(imgOuter)
					} else {
						bigOuter.append(imgOuter)
					}
					this.ballNumArray.push(imgObj)
				}
				var hisOuter = $(".guess_top_order_green_bottom");
				for (i = 0; i < 5; i++) {
					imgObj = $('<img alt="" class="hide"/>');
					imgOuter = $('<div class="guess_top_order_green_bottom_num"></div>').append(imgObj);
					hisOuter.append(imgOuter);
					this.historyNumList.push(imgObj)
				}
			},
			g_pageInit () {
				/*trade.showLoading();
				var urlType = $stateParams.type;
				if (JSUtils.string.isAvailably(urlType)) {
					type = urlType.substr(1)
				}*/
				this.bettingInfo.gtrade_time_out = 10;
				this.g_initBallNumArray();
				this.g_adjustPageInitWH();
				/*g_musicInit();*/
				this.g_srv_init()
			},
			g_playCountDown (cdType, cdTime) {
				countDownObj.countdownType = cdType;
				if (countDownObj.countdownType == 1) {
					countDownObj.curccNum = countDownObj.CD_ALLTIME * 10;
					countDownObj.countdownInterval = (cdTime - this.bettingInfo.gtrade_time_out) * countDownObj.DEF_INV / (countDownObj.CD_ALLTIME - this.bettingInfo.gtrade_time_out)
				} else {
					countDownObj.curccNum = cdTime * 10
				}
				this.g_loopCountDown()
			},
			g_loopCountDown () {
				var self = this
				if (countDownObj.curccNum < 0) {
					$("#countDownDesc").text("开奖中");
					if (self.bettingInfo.curBetting > 0 && JSUtils.string.isAvailably(this.billId)) {
						self.g_srv_queryRet()
					} else {
						self.g_srv_nomark()
					}
					return
				}
				if (countDownObj.curccNum <= self.bettingInfo.gtrade_time_out * 10) {
					if (!countDownObj.cdSetFlag) {
						countDownObj.cdSetFlag = true;
						countDownObj.countdownInterval = countDownObj.DEF_INV;
						self.bettingInfo.noBettingFlag = true;
						if (self.bettingInfo.curBetting > 0) {
							self.g_srv_mark();
							return
						}
					}
					if (countDownObj.curccNum % 10 == 0) {
						if (countDownObj.curccNum != 0) {
							if (countDownObj.curccNum <= 30) {
								self.g_musicPlay(4)
							}
							var countDownBox = $("#countDownBox");
							$(".cdNumLast", countDownBox).css({
								display: "flex"
							});
							$(".cdNumNormal", countDownBox).hide();
							self.timeoutss = JSUtils.number.chnInt(countDownObj.curccNum / 10);
							self.g_countDown("cdNumLast", self.timeoutss)
						} else {
							self.g_musicPlay(5)
						}
					}
					$("#countDownDesc").text("等待开奖")
				} else {
					countDownObj.cdSetFlag = false;
					if (countDownObj.curccNum % 10 == 0) {
						self.timeoutss = JSUtils.number.chnInt(countDownObj.curccNum / 10);
						$(".cdNumNormal", $("#countDownBox")).text(self.timeoutss)
					}
					$("#countDownDesc").text("下单中")
				}
				if (JSUtils.object.hasSepProperty(countDownObj.adustTimeMap, countDownObj.curccNum.toString()) && !countDownObj.adustTimeMap[countDownObj.curccNum.toString()]) {
					console.log("开始于服务器对时!       countDownObj.curccNum.toString()=" + countDownObj.curccNum.toString());
					countDownObj.adustTimeMap[countDownObj.curccNum.toString()] = true;
					self.g_srvQueryServerStatus(function(srvData) {
						curphaseids = srvData.gtradesrvstat["curphaseid"]
						$("#curphaseid").text(curphaseids);
						self.g_playCountDown(2, srvData.gtradesrvstat["timeoutss"])
					}, function() {
						self.g_playCountDown(2, JSUtils.number.chnInt(countDownObj.curccNum / 10))
					})
				} else {
					countDownObj.cdCanvas.beginDraw((10 / countDownObj.CD_ALLTIME) * (countDownObj.CD_ALLTIME * 10 - countDownObj.curccNum));
					countDownObj.curccNum--;
					timeOutControl.secTimeout = window.setTimeout(self.g_loopCountDown, countDownObj.countdownInterval)
				}
				/*countDownObj.cdCanvas.beginDraw((10 / countDownObj.CD_ALLTIME) * (countDownObj.CD_ALLTIME * 10 - countDownObj.curccNum));
				countDownObj.curccNum--;
				timeOutControl.secTimeout = window.setTimeout(self.g_loopCountDown, countDownObj.countdownInterval)*/
			},
			g_countDown (className, num) {
				$("." + className).transition({
					scale: 3
				}, 10, function() {
					$("." + className).css({
						display: "flex"
					}).html(num)
				}).transition({
					scale: 1
				}, 1000, function() {
					if (num > 0) {
						$("." + className).css({
							display: "none"
						})
					}
				})
			},
			g_winsAnimationgEnd (timeOut) {
				var self = this
				timeOutControl.reInitTimeout = window.setTimeout(function() {
					self.g_reinit()
				}, timeOut)
			},
			g_reinit () {
				var self = this
				this.g_srvQueryServerStatus(function(srvData) {
					self.g_cancleRotateDom();
					self.g_broadcast(srvData.usertrades);
					winningNumberObj = {};
					self.g_setHistoryBall(queryRetSrvJson.gtradehistory);
					curphaseids = srvData.gtradesrvstat["curphaseid"]
					$("#curphaseid").text(curphaseids);
					countDownObj.adustTimeMap = countDownObj.getadustTimeMap();
					self.g_playCountDown(2, srvData.gtradesrvstat["timeoutss"]);
					self.bettingInfo.noBettingFlag = false;
					var countDownBox = $("#countDownBox");
					$(".cdNumNormal", countDownBox).css({
						display: "flex"
					});
					$(".cdNumLast", countDownBox).hide()
				}, function() {
					timeOutControl.reinitTimeout = window.setTimeout(self.g_reinit, 1000)
				})
			},
			g_setHistoryBall(gtradehistory) {
				var dataLen = gtradehistory.length;
				var ballLen = this.historyNumList.length;
				for (var i = 0, j = ballLen - 1; i < ballLen; i++,
								j--) {
					var imgObj = this.historyNumList[i];
					var tmpNum = gtradehistory[j];
					imgObj.attr("src", "../static/images/guest/num/num-" + tmpNum + ".png");
					imgObj.show()
				}
			},
			g_cancleRotateDom() {
				document.getElementsByClassName("guess_top_order_green_top")[0].style.transform = "rotateY(0deg)";
				document.getElementsByClassName("guess_top_order_green_top_result")[0].style.display = "none";
				document.getElementsByClassName("guess_top_order_green_top_order")[0].style.display = "block";
				$(".result_last_num_back").removeAttr("style");
				this.hideBorder()
			},
			hideBorder() {
				for (var i = 0; i < 10; i++) {
					$("#guessBorder" + i).css({
						display: "none"
					})
				}
			},
			g_broadcast(usertrade) {
				if (usertrade && usertrade.tordernum && usertrade.nickname) {
					if (usertrade.tordernum == "-100") {
						horseContent = usertrade.nickname;
						$("#usertradenickname").text(usertrade.nickname)
					} else {
						horseContent = "";
						usertradenickname = "“" + usertrade.nickname + "”盈利";
						usertrattradeprofit = " " + JSUtils.number.formatMoney(usertrade.ttradeprofit) + " 元";
						$("#usertradenickname").text(usertradenickname + usertrattradeprofit)
					}
				}
			},
			g_srvQueryServerStatus (callBack, errFun) {
				/*trade.guestTradeQuerySrvStat(horn, function(data, status, error, srvJson) {
					if (callBack) {
						callBack(srvJson)
					}
				}, function() {
					if (errFun) {
						errFun()
					}
				})*/
				callBack(srvJson)
			},
			g_srv_init() {
				/*trade.guestTradeInit(targetId, horn, type, function(data, status, error, srvJson) {
					console.log("g_srv_init" + JSUtils.object.toJsonStr(srvJson));
					if (type == "V" && srvJson && srvJson.userinfo) {
						if (JSUtils.string.isAvailably(srvJson.userinfo["sessionid"])) {
							JSUtils.curApp.sessionObj.put("sessionId", srvJson.userinfo["sessionid"])
						}
					}
					if (error.errcode != 2000) {
						return
					}
					var i;
					bettingInfo.maxBetting = srvJson.maxMoney;
					g_setSurplusMoney(srvJson.account);
					g_broadcast(srvJson.usertrades);
					g_setHistoryBall(srvJson.gtradehistory);
				 this.curphaseid = srvJson.gtradesrvstat["curphaseid"];
					$("#curphaseid").text(this.curphaseid);
					g_playCountDown(2, srvJson.gtradesrvstat["timeoutss"]);
					g_showCurMark(srvJson.usergtrade);
					g_showHisMark(srvJson.usergtradenshow);
					trade.hideLoading()
				}, function() {})*/

				this.g_playCountDown(2, 14);
			//	this.g_playCountDown(2, srvJson.gtradesrvstat["timeoutss"]);
			},
			g_srv_nomark() {
				/*trade.guestTradeQueryHistory(function(data, status, error, srvJson) {
					console.log("g_srv_nomark" + JSUtils.object.toJsonStr(srvJson));
					var findFlag = false;
					for (var i = 0; i < srvJson.history.length; i++) {
						var tmpTradeObj = srvJson.history[i];
						if (tmpTradeObj.curphaseid == $scope.curphaseid) {
							queryRetSrvJson = {};
							queryRetSrvJson.usergtrade = tmpTradeObj;
							queryRetSrvJson.usergtrade["details"] = [];
							queryRetSrvJson.gtradehistory = g_historyLuckNumToHisNum(srvJson.history);
							g_process_winAni();
							findFlag = true;
							break
						}
					}
					if (!findFlag) {
						timeOutControl.srvNoMarkTimeout = window.setTimeout(g_srv_nomark, 1000)
					}
				}, function() {
					timeOutControl.srvNoMarkTimeout = window.setTimeout(g_srv_nomark, 1000)
				})*/
				var findFlag = false;
				for (var i = 0; i < srvJson.history.length; i++) {
					var tmpTradeObj = srvJson.history[i];
					if (tmpTradeObj.curphaseid == curphaseids) {
						queryRetSrvJson = {};
						queryRetSrvJson.usergtrade = tmpTradeObj;
						queryRetSrvJson.usergtrade["details"] = [];
						queryRetSrvJson.gtradehistory = this.g_historyLuckNumToHisNum(srvJson.history);
						this.g_process_winAni();
						findFlag = true;
					}
				}

				if (!findFlag) {
					timeOutControl.srvNoMarkTimeout = window.setTimeout(this.g_srv_nomark, 1000)
				}
			},
			g_srv_mark () {
				var details = [];
				for (var i in this.bettingInfo.gridInfo) {
					details.push(this.bettingInfo.gridInfo[i])
				}
				/*trade.guestTradeMark($scope.curphaseid, details, horn, type, function(data, status, error, srvJson) {
					console.log("g_srv_mark" + JSUtils.object.toJsonStr(srvJson) + "\n error=" + JSUtils.object.toJsonStr(error));
					g_setSurplusMoney(srvJson.account);
					if (error.errcode == "syslock_trade" || error.errcode == "lock_trade") {
						g_bettingforcecancel();
						$location.path("tabs/trade");
						return
					}
					if (!JSUtils.string.isAvailably(srvJson.billId)) {
						g_bettingforcecancel();
						return
					}
					if (error.errcode == 2000 || error.errcode == "limit_risk") {
						g_broadcast(srvJson.usertrades);
						billId = srvJson.billId;
						$scope.curphaseid = srvJson.gtradesrvstat["curphaseid"];
						$("#curphaseid").text($scope.curphaseid);
						g_playCountDown(2, srvJson.gtradesrvstat["timeoutss"])
					} else {
						g_bettingforcecancel();
						g_playCountDown(2, JSUtils.number.chnInt(countDownObj.curccNum / 10))
					}
				}, function() {
					g_bettingforcecancel();
					g_playCountDown(2, JSUtils.number.chnInt(countDownObj.curccNum / 10))
				})*/

			//	this.g_bettingforcecancel();
				this.g_playCountDown(2, JSUtils.number.chnInt(countDownObj.curccNum / 10))
			},
			g_bettingcancel () {
				if (this.bettingInfo.noBettingFlag) {
					return
				}
				this.g_bettingforcecancel()
			},
			g_bettingforcecancel () {
				$(".guess_top_orders_black_bg").hide();
				this.g_musicPlay(3);
				this.accountMoney = this.accountMoney + this.bettingInfo.curBetting + this.bettingInfo.curCounterFee;
				$("#accountMoney").text(JSUtils.number.formatNumeric(this.accountMoney, 0));
				this.bettingInfo.curBetting = 0;
				this.curBetting = JSUtils.number.formatNumeric(this.bettingInfo.curBetting, 0);
				this.bettingInfo.curCounterFee = 0;
				this.curCountFee = JSUtils.number.formatNumeric(this.bettingInfo.curCounterFee, 0);
				this.bettingInfo.gridInfo = {};
				$("#bettleMoneyDiv").hide();
				this.g_changeBallToInit();
				$(".guess_top_bottom_row_box_txt").show();
				$(".guess_top_bottom_row_box_img").hide()
			},
			g_changeBallToInit () {
				for (var i = 0; i < this.ballNumArray.length; i++) {
					this.g_changeBallNum(1, i)
				}
			},
			g_srv_queryRet() {
				if (!JSUtils.string.isAvailably(billId)) {
					return
				}
				/*trade.guestTradeQueryRet(billId, horn, function(data, status, error, srvJson) {
					console.log("g_srv_queryRet   srvJson" + JSUtils.object.toJsonStr(srvJson));
					console.log("g_srv_queryRet   error" + JSUtils.object.toJsonStr(error));
					if (srvJson.ret == "0") {
						timeOutControl.srvQueryRetTimeout = window.setTimeout(g_srv_queryRet, parseInt(srvJson.inv) * 1000)
					} else {
						queryRetSrvJson = srvJson;
						g_broadcast(queryRetSrvJson.usertrades);
						g_setSurplusMoney(queryRetSrvJson.account);
						bettingInfo.curBetting = 0;
						bettingInfo.curCounterFee = 0;
						bettingInfo.gridInfo = {};
						$("#bettleMoneyDiv").hide();
						g_changeBallToInit();
						g_process_winAni();
						trade.ViewMarketTrade([billId], function() {}, null)
					}
				}, function() {
					timeOutControl.srvQueryRetTimeout = window.setTimeout(g_srv_queryRet, 1000)
				})*/
				timeOutControl.srvQueryRetTimeout = window.setTimeout(this.g_srv_queryRet, 1000)
			},
			g_historyLuckNumToHisNum (hisArr) {
				console.log(hisArr[0]["luckynum"])
				var ret = [];
				for (let k = 0; k < hisArr.length; k++) {
					var tmpObj = this.g_processWinNum(hisArr[k]["luckynum"]);
					ret.push(tmpObj.lastNumSum)
				}
				return ret
			},
			g_processWinNum (qqNum) {
				var ret = {};
				var tmpStr = this.formatNum(qqNum);
				var tmplNum = tmpStr.lastIndexOf(",");
				ret.firstStr = tmpStr.substring(0, tmplNum + 1);
				ret.lastStr = tmpStr.substring(tmpStr.lastIndexOf(",") + 1, tmpStr.length);
				var len = ret.lastStr.length;
				ret.lastNumArray = [];
				ret.lastNumSum = 0;
				for (var i = 0; i < len; i++) {
					var tmpInt = JSUtils.number.chnInt(ret.lastStr.charAt(i));
					ret.lastNumArray.push(tmpInt);
					ret.lastNumSum = ret.lastNumSum + tmpInt
				}
				return ret
			},
			formatNum (strNum) {
				if (strNum.length <= 3) {
					return strNum
				}
				if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(strNum)) {
					return strNum
				}
				var a = RegExp.$1
								, b = RegExp.$2
								, c = RegExp.$3;
				var re = new RegExp();
				re.compile("(\\d)(\\d{3})(,|$)");
				while (re.test(b)) {
					b = b.replace(re, "$1,$2$3")
				}
				return a + "" + b + "" + c
			},
			g_process_winAni () {
				var self = this
				winningNumberObj = this.g_processWinNum(queryRetSrvJson.usergtrade["luckynum"]);
				this.g_musicPlay(6);
				this.g_rotateDom(winningNumberObj, function() {
					var gridArr = g_winGetGridInfo(winningNumberObj.lastNumArray, winningNumberObj.lastNumSum);
					showBorder(gridArr);
					timeOutControl.flyCoinTimeout = window.setTimeout(function() {
						var tmpMap = {};
						var i, tmpObj;
						for (i = 0; i < queryRetSrvJson.usergtrade["details"].length; i++) {
							tmpObj = queryRetSrvJson.usergtrade["details"][i];
							tmpMap[tmpObj.gridid] = tmpObj
						}
						if (queryRetSrvJson.usergtrade["details"].length > 0) {
							for (i = 0; i < gridArr.length; i++) {
								var tmpNum = gridArr[i];
								var gridId = GRID_ID_PREFIX + i;
								if (tmpNum == 1) {
									if (tmpMap[gridId]) {
										tmpObj = tmpMap[gridId];
										this.g_downFly(gridId, tmpObj.lastcointype)
									}
								} else {
									if (tmpMap[gridId]) {
										tmpObj = tmpMap[gridId];
										this.g_upFly(gridId, tmpObj.lastcointype)
									}
								}
							}
						} else {
							self.g_winsAnimationgEnd(2000)
						}
					}, 2000)
				})
			},

			g_downFly (gridId, coinType) {
				this.winsAniNums++;
				var firstFlag = true;
				parabola(this.g_downDomcreat(coinType), "userMoney", function() {
					this.g_flycallback()
				}, function(x, y) {
					var offTop = $("#" + gridId).offset().top;
					if (y >= offTop - 100) {
						if (firstFlag) {
							firstFlag = false;
							g_downFlyUser(gridId, coinType)
						}
					}
				})
			},
			g_upFly (str, coinType) {
				this.winsAniNums++;
				var gridJQObj = $("#" + str);
				var domParent = $(".guess_top_orders_black_bg", gridJQObj).get(0);
				$(".guess_top_orders_black_img", $(".guess_top_orders_black_bg", gridJQObj)).css({
					display: "none"
				});
				var domCreat = g_upDomcreat(domParent, coinType);
				parabola(domCreat, "dealerOne", function() {
					this.winsAniNums--;
					if (winsAniNums <= 0) {
						this.winsAniNums = 0;
						this.g_winsAnimationgEnd(500)
					}
				})
			},
			g_flycallback () {
				this.winsAniNums--;
				if (this.winsAniNums <= 0) {
					this.winsAniNums = 0;
					this.g_winsAnimationgEnd(500)
				}
			},
			g_downDomcreat(coinType) {
				var newdom = document.createElement("div");
				newdom.style.top = (Math.random() * 100) + "px";
				newdom.style.left = (Math.random() * 20) + "px";
				if (coinType == "one") {
					newdom.setAttribute("class", "img_small")
				}
				if (coinType == "five") {
					newdom.setAttribute("class", "img_center")
				}
				if (coinType == "ten") {
					newdom.setAttribute("class", "img_big")
				}
				document.getElementById("dealerOne").appendChild(newdom);
				return newdom
			},
			g_rotateDom(obj, callback) {
				$(".result_title_txt_num").html(obj.firstStr);
				$(".result_title_txt_color").html(obj.lastStr);
				$(".result_last_num1").html(obj.lastNumArray[0]);
				$(".result_last_num2").html(obj.lastNumArray[1]);
				$(".result_last_num3").html(obj.lastNumArray[2]);
				document.getElementsByClassName("guess_top_order_green_top")[0].style.transform = "rotateY(180deg)";
				document.getElementsByClassName("guess_top_order_green_top_order")[0].style.display = "none";
				document.getElementsByClassName("guess_top_order_green_top_result")[0].style.display = "block";
				this.g_rusultAnimate(callback)
			},
			g_rusultAnimate(callback) {
				this.g_titleAnimate(callback)
			},
			g_titleAnimate(callback) {
				$(".result_title").transition({
					translate: [0, 0]
				}, 1000, this.g_three_add(callback))
			},
			g_three_add(callback) {
				$(".result_last_num1").transition({
					perspective: "500px",
					translate: [80, 80],
					rotate: 720
				}, 500, function() {
					$(".result_last_num_add1").transition({
						perspective: "500px",
						translate: [80, 80],
						rotate: 720
					}, 500, function() {
						$(".result_last_num2").transition({
							perspective: "500px",
							translate: [80, 80],
							rotate: 720
						}, 500, function() {
							$(".result_last_num_add2").transition({
								perspective: "500px",
								translate: [80, 80],
								rotate: 720
							}, 500, function() {
								$(".result_last_num3").transition({
									perspective: "500px",
									translate: [80, 80],
									rotate: 720
								}, 500, function() {
									$(".result_last_num_equle").transition({
										perspective: "500px",
										translate: [80, 80],
										rotate: 720
									}, 500, function() {
										$(".result_number").transition({
											scale: 3
										}, 10, function() {
											$(".result_number").css({
												display: "block"
											}).html(winningNumberObj.lastNumSum)
										}).transition({
											scale: 1
										}, 300, function() {}).transition({
											scale: 1.2
										}, 80, function() {}).transition({
											scale: 1
										}, 100, function() {
											callback()
										})
									})
								})
							})
						})
					})
				})
			},

		},
		components: {
		}
	}



	function DrawCircle() {}
	DrawCircle.prototype = {
		drawCircleInit: function(canvasId, pos, roundNum, initAngle, fillStyle) {
			this.pos = pos;
			this.roundNum = roundNum;
			this.initAngle = initAngle;
			this.fillStyle = fillStyle;
			var canvas = document.getElementById(canvasId);
			this.ctx = canvas.getContext("2d");
			this.canvasWH = {
				w: canvas.getAttribute("width"),
				h: canvas.getAttribute("height")
			};
			this.ctx.fillStyle = this.fillStyle
		},
		beginDraw: function(num) {
			this.ctx.clearRect(0, 0, this.canvasWH.w, this.canvasWH.h);
			var endAngle = parseFloat(num) * 2 / 100 + this.initAngle;
			this.ctx.beginPath();
			this.ctx.moveTo(this.pos.x, this.pos.y);
			this.ctx.arc(this.pos.x, this.pos.y, this.roundNum, this.initAngle * Math.PI, endAngle * Math.PI);
			this.ctx.lineTo(this.pos.x, this.pos.y);
			this.ctx.fill()
		}
	};

	function parabola(element, targetid, callback, progress) {
		var funParabola = function(element, target, options) {
			var defaults = {
				speed: 36.67 * 6,
				curvature: 0,
				progress: function(x, y) {
					if (progress) {
						progress(x, y)
					}
				},
				complete: function() {
					callback();
					element.parentNode.removeChild(element)
				}
			};
			var params = {};
			options = options || {};
			for (var key in defaults) {
				params[key] = options[key] || defaults[key]
			}
			var exports = {
				mark: function() {
					return this
				},
				position: function() {
					return this
				},
				move: function() {
					return this
				},
				init: function() {
					return this
				}
			};
			var moveStyle = "margin"
							, testDiv = document.createElement("div");
			if ("oninput"in testDiv) {
				["", "ms", "webkit"].forEach(function(prefix) {
					var transform = prefix + (prefix ? "T" : "t") + "ransform";
					if (transform in testDiv.style) {
						moveStyle = transform
					}
				})
			}
			var a = params.curvature
							, b = 0
							, c = 0;
			var flagMove = true;
			if (element && target && element.nodeType == 1 && target.nodeType == 1) {
				var rectElement = {}
								, rectTarget = {};
				var centerElement = {}
								, centerTarget = {};
				var coordElement = {}
								, coordTarget = {};
				exports.mark = function() {
					if (flagMove == false) {
						return this
					}
					if (typeof coordElement.x == "undefined") {
						this.position()
					}
					element.setAttribute("data-center", [coordElement.x, coordElement.y].join());
					target.setAttribute("data-center", [coordTarget.x, coordTarget.y].join());
					return this
				}
				;
				exports.position = function() {
					if (flagMove == false) {
						return this
					}
					var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
									, scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
					if (moveStyle == "margin") {
						element.style.marginLeft = element.style.marginTop = "0px"
					} else {
						element.style[moveStyle] = "translate(0, 0)"
					}
					rectElement = element.getBoundingClientRect();
					rectTarget = target.getBoundingClientRect();
					centerElement = {
						x: rectElement.left + (rectElement.right - rectElement.left) / 2 + scrollLeft,
						y: rectElement.top + (rectElement.bottom - rectElement.top) / 2 + scrollTop
					};
					centerTarget = {
						x: rectTarget.left + (rectTarget.right - rectTarget.left) / 2 + scrollLeft,
						y: rectTarget.top + (rectTarget.bottom - rectTarget.top) / 2 + scrollTop
					};
					coordElement = {
						x: 0,
						y: 0
					};
					coordTarget = {
						x: -1 * (centerElement.x - centerTarget.x),
						y: -1 * (centerElement.y - centerTarget.y)
					};
					b = (coordTarget.y - a * coordTarget.x * coordTarget.x) / coordTarget.x;
					return this
				}
				;
				exports.move = function() {
					if (flagMove == false) {
						return this
					}
					var startx = 0
									, rate = coordTarget.x > 0 ? 1 : -1;
					var step = function() {
						var tangent = 2 * a * startx + b;
						startx = startx + rate * Math.sqrt(params.speed / (tangent * tangent + 1));
						if ((rate == 1 && startx > coordTarget.x) || (rate == -1 && startx < coordTarget.x)) {
							startx = coordTarget.x
						}
						var x = startx
										, y = a * x * x + b * x;
						element.setAttribute("data-center", [Math.round(x), Math.round(y)].join());
						if (moveStyle == "margin") {
							element.style.marginLeft = x + "px";
							element.style.marginTop = y + "px"
						} else {
							element.style[moveStyle] = "translate(" + [x + "px", y + "px"].join() + ")"
						}
						if (startx !== coordTarget.x) {
							params.progress(x, y);
							window.requestAnimationFrame(step)
						} else {
							params.complete();
							flagMove = true
						}
					};
					window.requestAnimationFrame(step);
					flagMove = false;
					return this
				}
				;
				exports.init = function() {
					this.position().mark().move()
				}
			}
			return exports
		};
		var target = document.getElementById(targetid);
		var parabola = funParabola(element, target).mark();
		parabola.init()
	}

	function g_winGetGridInfo (lastNumArr, lastNumSum) {
		var ret = [];
		for (var i = 0; i <= 9; i++) {
			ret[i] = 0
		}
		if (lastNumSum <= 13) {
			ret[7] = 1;
			if (lastNumSum % 2 == 0) {
				ret[2] = 1;
				ret[9] = 1
			} else {
				ret[6] = 1;
				ret[8] = 1
			}
		} else {
			ret[1] = 1;
			if (lastNumSum % 2 == 0) {
				ret[2] = 1;
				ret[3] = 1
			} else {
				ret[0] = 1;
				ret[8] = 1
			}
		}
		if ((lastNumArr[2] - lastNumArr[1] == 1 && lastNumArr[2] - lastNumArr[0] == 2) || lastNumArr[0] - lastNumArr[1] == 1 && lastNumArr[0] - lastNumArr[2] == 2) {
			ret[5] = 1
		}
		if (lastNumArr[2] == lastNumArr[1] && lastNumArr[2] == lastNumArr[0]) {
			ret[4] = 1
		}
		return ret
	}

	function showBorder(arr) {
		for (var i = 0; i < arr.length; i++) {
			var tmpNum = arr[i];
			if (tmpNum == 1) {
				$("#guessBorder" + i).css({
					display: "block"
				})
			}
		}
	}
</script>

<style>

	#main {
		width: 100%;
		height: 100%;
	}
</style>